#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main()
{
	int n, a, b, c;
	scanf("%d", &n);
	for (a = 0; a <= n / 5.0; a++)
	{
		for (b = 0; b <= n / 3.0; b++)
		{
			c = 3 * (n - 5 * a - 3 * b);
			if (a + b + c == n)
				printf("%d %d %d\n", a, b, c);
		}
	}
	return 0;
}